$(function() {
	$("#form").validate({
		rules : {
			"setcheckstate" : {
				required : true
			}
		},
		messages : {
			"setcheckstate" : {
				required : '请选择审查意见!'
			}
		}
	});
	
	$("#setcheckstate").change(function() {
		var states = $('#setcheckstate').val();
		if (states == 1 || states == "") {
			var s = "确定";
			$("#submit").val(s);
		} else if (states == 2) {
			var s = "退回";
			$("#submit").val(s);
			
		}
	});
	$(document).ready(function(){
		var canUseMoney = $("#canUseMoney").val() * 1;
		var applyMoney = $("#applyMoney").val() * 1;
		
		if(applyMoney > canUseMoney){
			$("#setcheckstate").val(2);
		}
	});
	
});
